import request from '@/utils/request'
import { requestNew } from '@/utils/request'

// 抽奖活动配置
export async function drawConfig(data,showLoading=false) {
  const res = await requestNew({
    url: '/luckdraw/config',
    method: 'get',
    custom_baseURL:'VUE_APP_MINI_API',
    data,
    headers: {
      showLoading
    }
  })
  return res
}
// 用户参与抽奖记录
export async function drawRecord(data,showLoading=false) {
  const res = await requestNew({
    url: '/luckdraw/draw_record',
    method: 'get',
    custom_baseURL:'VUE_APP_MINI_API',
    data,
    headers: {
      showLoading
    }
  })
  return res
}
// go
export async function drawResult(data,showLoading=false) {
  const res = await requestNew({
    url: '/luckdraw/go',
    method: 'post',
    custom_baseURL:'VUE_APP_MINI_API',
    timeout:10000,
    data,
    headers: {
      showLoading,
      showMessage:false
    }
  })
  return res
}
// 某个用户参与抽奖记录
export async function myDrawRecord(data) {
  const res = await requestNew({
    url: '/luckdraw/my_draw_record',
    method: 'get',
    custom_baseURL:'VUE_APP_MINI_API',
    data
  })
  return res
}
// 某个用户抽奖次数明细记录
export async function getNumRecordList(data) {
  const res = await requestNew({
    url: '/luckdraw/getNumRecordList',
    method: 'get',
    custom_baseURL:'VUE_APP_MINI_API',
    data
  })
  return res
}